Integrand size = 21, antiderivative size = 103 \[ \int \frac {\csc (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=-\frac {\text {arctanh}(\cos (c+d x))}{a^2 d}+\frac {\sqrt {b} (3 a+2 b) \text {arctanh}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{2 a^2 (a+b)^{3/2} d}+\frac {b \cos (c+d x)}{2 a (a+b) d \left (a+b-b \cos ^2(c+d x)\right )} \]
[Out]
Time = 0.09 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3265, 425, 536, 212, 214} \[ \int \frac {\csc (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\frac {\sqrt {b} (3 a+2 b) \text {arctanh}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{2 a^2 d (a+b)^{3/2}}-\frac {\text {arctanh}(\cos (c+d x))}{a^2 d}+\frac {b \cos (c+d x)}{2 a d (a+b) \left (a-b \cos ^2(c+d x)+b\right )} \]
[In]
[Out]
Rule 212
Rule 214
Rule 425
Rule 536
Rule 3265
Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {1}{\left (1-x^2\right ) \left (a+b-b x^2\right )^2} \, dx,x,\cos (c+d x)\right )}{d} \\ & = \frac {b \cos (c+d x)}{2 a (a+b) d \left (a+b-b \cos ^2(c+d x)\right )}+\frac {\text {Subst}\left (\int \frac {-2 a-b-b x^2}{\left (1-x^2\right ) \left (a+b-b x^2\right )} \, dx,x,\cos (c+d x)\right )}{2 a (a+b) d} \\ & = \frac {b \cos (c+d x)}{2 a (a+b) d \left (a+b-b \cos ^2(c+d x)\right )}-\frac {\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{a^2 d}+\frac {(b (3 a+2 b)) \text {Subst}\left (\int \frac {1}{a+b-b x^2} \, dx,x,\cos (c+d x)\right )}{2 a^2 (a+b) d} \\ & = -\frac {\text {arctanh}(\cos (c+d x))}{a^2 d}+\frac {\sqrt {b} (3 a+2 b) \text {arctanh}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{2 a^2 (a+b)^{3/2} d}+\frac {b \cos (c+d x)}{2 a (a+b) d \left (a+b-b \cos ^2(c+d x)\right )} \\ \end{align*}
Result contains complex when optimal does not.
Time = 1.15 (sec) , antiderivative size = 194, normalized size of antiderivative = 1.88 \[ \int \frac {\csc (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\frac {\frac {\sqrt {b} (3 a+2 b) \arctan \left (\frac {\sqrt {b}-i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )}{(-a-b)^{3/2}}+\frac {\sqrt {b} (3 a+2 b) \arctan \left (\frac {\sqrt {b}+i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )}{(-a-b)^{3/2}}+2 \left (\frac {a b \cos (c+d x)}{(a+b) (2 a+b-b \cos (2 (c+d x)))}-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )}{2 a^2 d} \]
[In]
[Out]
Time = 0.92 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.04
method | result | size |
derivativedivides | \(\frac {-\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{2 a^{2}}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a^{2}}+\frac {b \left (\frac {a \cos \left (d x +c \right )}{2 \left (a +b \right ) \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}+\frac {\left (3 a +2 b \right ) \operatorname {arctanh}\left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \left (a +b \right ) \sqrt {\left (a +b \right ) b}}\right )}{a^{2}}}{d}\) | \(107\) |
default | \(\frac {-\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{2 a^{2}}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a^{2}}+\frac {b \left (\frac {a \cos \left (d x +c \right )}{2 \left (a +b \right ) \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}+\frac {\left (3 a +2 b \right ) \operatorname {arctanh}\left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \left (a +b \right ) \sqrt {\left (a +b \right ) b}}\right )}{a^{2}}}{d}\) | \(107\) |
risch | \(-\frac {b \left ({\mathrm e}^{3 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}\right )}{a \left (a +b \right ) d \left (b \,{\mathrm e}^{4 i \left (d x +c \right )}-4 a \,{\mathrm e}^{2 i \left (d x +c \right )}-2 b \,{\mathrm e}^{2 i \left (d x +c \right )}+b \right )}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d \,a^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d \,a^{2}}+\frac {3 i \sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {-\left (a +b \right ) b}\, {\mathrm e}^{i \left (d x +c \right )}}{b}+1\right )}{4 \left (a +b \right )^{2} d a}+\frac {i \sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {-\left (a +b \right ) b}\, {\mathrm e}^{i \left (d x +c \right )}}{b}+1\right ) b}{2 \left (a +b \right )^{2} d \,a^{2}}-\frac {3 i \sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {-\left (a +b \right ) b}\, {\mathrm e}^{i \left (d x +c \right )}}{b}+1\right )}{4 \left (a +b \right )^{2} d a}-\frac {i \sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {-\left (a +b \right ) b}\, {\mathrm e}^{i \left (d x +c \right )}}{b}+1\right ) b}{2 \left (a +b \right )^{2} d \,a^{2}}\) | \(343\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 208 vs. \(2 (94) = 188\).
Time = 0.31 (sec) , antiderivative size = 455, normalized size of antiderivative = 4.42 \[ \int \frac {\csc (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\left [-\frac {2 \, a b \cos \left (d x + c\right ) - {\left ({\left (3 \, a b + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 3 \, a^{2} - 5 \, a b - 2 \, b^{2}\right )} \sqrt {\frac {b}{a + b}} \log \left (\frac {b \cos \left (d x + c\right )^{2} + 2 \, {\left (a + b\right )} \sqrt {\frac {b}{a + b}} \cos \left (d x + c\right ) + a + b}{b \cos \left (d x + c\right )^{2} - a - b}\right ) + 2 \, {\left ({\left (a b + b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} - 2 \, a b - b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 2 \, {\left ({\left (a b + b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} - 2 \, a b - b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, {\left ({\left (a^{3} b + a^{2} b^{2}\right )} d \cos \left (d x + c\right )^{2} - {\left (a^{4} + 2 \, a^{3} b + a^{2} b^{2}\right )} d\right )}}, -\frac {a b \cos \left (d x + c\right ) + {\left ({\left (3 \, a b + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 3 \, a^{2} - 5 \, a b - 2 \, b^{2}\right )} \sqrt {-\frac {b}{a + b}} \arctan \left (\sqrt {-\frac {b}{a + b}} \cos \left (d x + c\right )\right ) + {\left ({\left (a b + b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} - 2 \, a b - b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left ({\left (a b + b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} - 2 \, a b - b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, {\left ({\left (a^{3} b + a^{2} b^{2}\right )} d \cos \left (d x + c\right )^{2} - {\left (a^{4} + 2 \, a^{3} b + a^{2} b^{2}\right )} d\right )}}\right ] \]
[In]
[Out]
\[ \int \frac {\csc (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\int \frac {\csc {\left (c + d x \right )}}{\left (a + b \sin ^{2}{\left (c + d x \right )}\right )^{2}}\, dx \]
[In]
[Out]
none
Time = 0.35 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.45 \[ \int \frac {\csc (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\frac {\frac {2 \, b \cos \left (d x + c\right )}{a^{3} + 2 \, a^{2} b + a b^{2} - {\left (a^{2} b + a b^{2}\right )} \cos \left (d x + c\right )^{2}} - \frac {{\left (3 \, a b + 2 \, b^{2}\right )} \log \left (\frac {b \cos \left (d x + c\right ) - \sqrt {{\left (a + b\right )} b}}{b \cos \left (d x + c\right ) + \sqrt {{\left (a + b\right )} b}}\right )}{{\left (a^{3} + a^{2} b\right )} \sqrt {{\left (a + b\right )} b}} - \frac {2 \, \log \left (\cos \left (d x + c\right ) + 1\right )}{a^{2}} + \frac {2 \, \log \left (\cos \left (d x + c\right ) - 1\right )}{a^{2}}}{4 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 246 vs. \(2 (94) = 188\).
Time = 0.43 (sec) , antiderivative size = 246, normalized size of antiderivative = 2.39 \[ \int \frac {\csc (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=-\frac {\frac {{\left (3 \, a b + 2 \, b^{2}\right )} \arctan \left (\frac {b \cos \left (d x + c\right ) + a + b}{\sqrt {-a b - b^{2}} \cos \left (d x + c\right ) + \sqrt {-a b - b^{2}}}\right )}{{\left (a^{3} + a^{2} b\right )} \sqrt {-a b - b^{2}}} - \frac {2 \, {\left (a b - \frac {a b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {2 \, b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )}}{{\left (a^{3} + a^{2} b\right )} {\left (a - \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {4 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}} - \frac {\log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{a^{2}}}{2 \, d} \]
[In]
[Out]
Time = 14.48 (sec) , antiderivative size = 2039, normalized size of antiderivative = 19.80 \[ \int \frac {\csc (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\text {Too large to display} \]
[In]
[Out]